package fristphase.day9_13;

import java.util.Random;
import java.util.Scanner;

public class 验证码练习 {
    public static void main(String[] args) {
        String mySrc = "1234567890abcdefghijklmnopqrstuvwxyz";
        Random random = new Random();
        String content = "";
        System.out.print("验证码：");
        for (int i = 0; i < 4; i++) {
            char single = mySrc.charAt(random.nextInt(36));
            content += single;
        }
        System.out.println(content);
        System.out.print("请输入验证码：");
        String answer = new Scanner(System.in).nextLine();
        if(answer.equalsIgnoreCase(content)){
            System.out.println("right");
        }else {
            System.out.println("false");
        }
    }
}
